package com.springsecurity.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springsecurity.pojo.SysRight;
import org.apache.ibatis.annotations.Select;

import java.io.Serializable;
import java.util.List;

public interface SysRightMapper extends BaseMapper<SysRight> {

    //按role_id 查对应的权限
    @Select("SELECT sr.right_url,sr.right_type,sr.right_text,sr.right_code" +
            " FROM  sys_role r" +
            " left join sys_role_right rr" +
            " on r.role_id =rr.rf_role_id" +
            " inner join sys_right sr" +
            " on rr.rf_right_code =sr.right_code" +
            " where r.role_id=#{roleId}")
    //登录时按roleId查权限,授权时从主体获得并遍历加入zinfo
    public List<SysRight> getSysRightByUserRoleId(Long roleId);

    //查所有 用接口中默认的查所有的方法即可


}
